package com.newa.beans;

import java.util.StringTokenizer;

public class Work {
	private int ID;
	private Section SECTION_ID;
	private String LINK;
	private String TECHNOLOGY;
	private String ABOUT;
	private String ABOUT_RU;
	private String ABOUT_CZ;
	private String NAME;
	private String NAME_RU;
	private String NAME_CZ;
	private String PHOTO_LINKS;
	private String LPHOTO_LINKS;
	private String LOGO_LINK;

	public Work() {
	}

	public Work(int iD, Section sECTION_ID, String lINK, String tECHNOLOGY,
			String aBOUT, String aBOUT_RU, String aBOUT_CZ, String nAME,
			String nAME_RU, String nAME_CZ, String pHOTO_LINKS,
			String lPHOTO_LINKS, String lOGO_LINK) {
		super();
		ID = iD;
		SECTION_ID = sECTION_ID;
		LINK = lINK;
		TECHNOLOGY = tECHNOLOGY;
		ABOUT = aBOUT;
		ABOUT_RU = aBOUT_RU;
		ABOUT_CZ = aBOUT_CZ;
		NAME = nAME;
		NAME_RU = nAME_RU;
		NAME_CZ = nAME_CZ;
		PHOTO_LINKS = pHOTO_LINKS;
		LPHOTO_LINKS = lPHOTO_LINKS;
		LOGO_LINK = lOGO_LINK;
	}

	public String getLPHOTO_LINKS() {
		return LPHOTO_LINKS;
	}

	public void setLPHOTO_LINKS(String lPHOTO_LINKS) {
		LPHOTO_LINKS = lPHOTO_LINKS;
	}

	public String getLINK() {
		return LINK;
	}

	public void setLINK(String lINK) {
		LINK = lINK;
	}

	public String getTECHNOLOGY() {
		return TECHNOLOGY;
	}

	public void setTECHNOLOGY(String tECHNOLOGY) {
		TECHNOLOGY = tECHNOLOGY;
	}

	public int getID() {
		return ID;
	}

	public void setID(int iD) {
		ID = iD;
	}

	public Section getSECTION_ID() {
		return SECTION_ID;
	}

	public void setSECTION_ID(Section sECTION_ID) {
		SECTION_ID = sECTION_ID;
	}

	public String getABOUT() {
		return ABOUT;
	}

	public void setABOUT(String aBOUT) {
		ABOUT = aBOUT;
	}

	public String getABOUT_RU() {
		return ABOUT_RU;
	}

	public void setABOUT_RU(String aBOUT_RU) {
		ABOUT_RU = aBOUT_RU;
	}

	public String getABOUT_CZ() {
		return ABOUT_CZ;
	}

	public void setABOUT_CZ(String aBOUT_CZ) {
		ABOUT_CZ = aBOUT_CZ;
	}

	public String getNAME() {
		return NAME;
	}

	public void setNAME(String nAME) {
		NAME = nAME;
	}

	public String getNAME_RU() {
		return NAME_RU;
	}

	public void setNAME_RU(String nAME_RU) {
		NAME_RU = nAME_RU;
	}

	public String getNAME_CZ() {
		return NAME_CZ;
	}

	public void setNAME_CZ(String nAME_CZ) {
		NAME_CZ = nAME_CZ;
	}

	public String getPHOTO_LINKS() {
		return PHOTO_LINKS;
	}

	public void setPHOTO_LINKS(String pHOTO_LINKS) {
		PHOTO_LINKS = pHOTO_LINKS;
	}

	public String getLOGO_LINK() {
		return LOGO_LINK;
	}

	public void setLOGO_LINK(String lOGO_LINK) {
		LOGO_LINK = lOGO_LINK;
	}

	public String getViewLPhoto(int i) {
		StringTokenizer tok = new StringTokenizer(LPHOTO_LINKS, ";");
		int j = 1;
		while (tok.hasMoreTokens() && j++ != i) {
			tok.nextToken();
		}
		String parse = tok.nextToken();
		int li = parse.lastIndexOf('/');
		String res = "/photos";
		res += parse.substring(li);
		return res;
	}

	public String getViewPhoto(int i) {
		StringTokenizer tok = new StringTokenizer(PHOTO_LINKS, ";");
		int j = 1;
		while (tok.hasMoreTokens() && j++ != i) {
			tok.nextToken();
		}
		String parse = tok.nextToken();
		int li = parse.lastIndexOf('/');
		String res = "/photos";
		res += parse.substring(li);
		return res;
	}

	public String getViewLogo() {
		String parse = getLOGO_LINK();
		if (parse != null) {
			int li = parse.lastIndexOf('/');
			String res = "/photos";
			res += parse.substring(li);
			return res;
		}
		return null;
	}

}
